<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input value="" type="text">
    <button>test</button>
</body>
<script>
    $('button').click(function(){
        alert($('input').val())
        let value = $('input')
        $.ajax({
            url:'/Home/index/test',
            type:'post',
            data:$('input').val(),
            success:function(res){
                alert(res)
                console.log(res);
            }
        })
    })
</script>
</html>